home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Various / S.N.A.G. Disk of the Month 91-03 (1991)(Southern Nevada Amiga Group)(PD).zip / S.N.A.G. Disk of the Month 91-03 (1991)(Southern Nevada Amiga Group)(PD).adf / PIV / gads.c < prev    next >
C/C++ Source or Header  |  1991-03-29  |  2KB  |  127 lines

  1. /* gads.c
  2.  *
  3.  * Gadget definitions for PIV
  4.  *
  5.  * (c) Copyright 1991 J.E.Hanway
  6.  *
  7.  * $Id: gads.c,v 1.1 91/03/13 22:33:05 jeh Exp $
  8.  *
  9.  * $Log:    gads.c,v $
  10.  * Revision 1.1  91/03/13  22:33:05  jeh
  11.  * Initial revision
  12.  * 
  13.  */
  14.  
  15. #include <exec/types.h>
  16. #include <intuition/intuition.h>
  17.  
  18. #include "PIV.h"
  19.  
  20. /* shorthand */
  21.  
  22. #define ITEXT(label,x,y,string,next) \
  23. static struct IntuiText label = { 0,1,JAM2,x,y,&TOPAZ80,string,next }
  24.    
  25. #define EXPLAIN(label,string) ITEXT(label,60,3,string,NULL)
  26.  
  27. #define BUTTEXT(label,string,next) ITEXT(label,2,2,string,next)
  28.  
  29. #define BUTGAD(label,y,text,id) \
  30. static struct Gadget label = {\
  31. NULL,10,y,51,12,\
  32. NULL,RELVERIFY,BOOLGADGET,(APTR)&but_bor,NULL,text,NULL,NULL,id,NULL }
  33.  
  34. #define BUTTON(label,name,explanation) \
  35. EXPLAIN(label##_t2, explanation);\
  36. BUTTEXT(label##_t1, #name, &label##_t2);\
  37. BUTGAD(label,name*20+24,&label##_t1,name)
  38.  
  39. static struct TextAttr TOPAZ80 = { "topaz.font",TOPAZ_EIGHTY,0,0 };
  40.  
  41. ITEXT(t10, 10, 28, "is not mounted.  You may:", NULL);
  42. ITEXT(t9, 10, 16, NULL, &t10);
  43.  
  44. static struct Image white_image = {
  45.    4,11,302,111,0,
  46.    NULL,
  47.    0x0, 0x1,
  48.    NULL
  49. };
  50.  
  51. static SHORT outer_lines[] = {
  52.     0,0,
  53.     56,0,
  54.     56,17,
  55.     0,17,
  56.     0,0
  57. };
  58. static struct Border outer_but_bor = {
  59.     -3,-3,
  60.     3,0,JAM1,
  61.     5,
  62.     outer_lines,
  63.     NULL
  64. };
  65. static SHORT inner_lines[] = {
  66.     0,0,
  67.     52,0,
  68.     52,13,
  69.     0,13,
  70.     0,0
  71. };
  72. static struct Border but_bor = {
  73.     -1,-1,
  74.     0,0,JAM1,
  75.     5,
  76.     inner_lines,
  77.     &outer_but_bor
  78. };
  79.  
  80. BUTTON(g1, RETRY, "after inserting the volume.");
  81.  
  82. BUTTON(g2, ASSIGN, "the volume to");
  83.  
  84. BUTTON(g3, MOUNT, "the device.");
  85.  
  86. BUTTON(g4, CANCEL, "the operation.");
  87.  
  88. /* string gadget for assign */
  89. static struct Gadget g5 = {
  90.     NULL,
  91.     180,67,
  92.     120,10,
  93.     NULL,
  94.     RELVERIFY,
  95.     STRGADGET,
  96.     NULL,NULL,NULL,NULL,NULL,
  97.     ASSIGN,
  98.     NULL
  99. };
  100.  
  101. /* dummy gadget for white background and text */
  102. static struct Gadget g6 = {
  103.    NULL,0,0,0,0,GADGIMAGE,NULL,BOOLGADGET,
  104.    (APTR) &white_image,
  105.    NULL,NULL,NULL,NULL,
  106.    NULL,
  107.    NULL
  108. };
  109.  
  110. struct Gadget *gproto[6] = { &g1, &g2, &g3, &g4, &g5, &g6 };
  111.    
  112. struct NewWindow nw_proto = {
  113.     0, 0, 310, 124,
  114.     0,1,
  115.     GADGETUP,
  116.     WINDOWDRAG | WINDOWDEPTH | ACTIVATE | RMBTRAP | NOCAREREFRESH,
  117.     NULL,
  118.     NULL,
  119.     "System Request",
  120.     NULL,
  121.     NULL,
  122.     0,0,0,0,
  123.     0
  124. };
  125.  
  126. struct IntuiText *vol_text = &t9;
  127.